#@layout()


#define content()
    <section class="content-header">
        <h1>
            优惠券使用记录
            <small>Coupon Used Record</small>
        </h1>
    </section>

    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">

                    <!-- /.card-header -->
                    <div class="card-body p-0">

                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <th style="width: 15%">优惠码</th>
                                <th style="width: 15%">用户</th>
                                <th style="width: 10%">订单</th>
                                <th style="width: 25%">优惠券</th>
                                <th style="width: 10%">优惠券归属用户</th>
                                <th style="width: 10%">使用时间</th>
                            </tr>
                            #for(record : page.list ??)
                            <tr>
                                <td>
                                    <strong>
                                        #(record.code ??)
                                    </strong>
                                </td>
                                <td>
                                    <a href="#(CPATH)/admin/user/detail/#(record.used_user_id ??)">#(record.used_user_nickname ??)</a>
                                </td>
                                <td>
                                    <a href="#(CPATH)/admin/order/detail/#(record.used_order_id ??)">#(record.userOrder.product_title ??)</a>
                                </td>
                                <td>#(record.couponCode.title ??)</td>
                                <td>
                                    <a href="#(CPATH)/admin/user/detail/#(record.code_user_id ??)"> #(record.code_user_nickname ??)</a>
                                </td>
                                <td>#date(record.created ??)</td>
                            </tr>
                            #else
                            <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                            #end
                            </tbody>
                        </table>
                    </div>
                    <!-- /.card-body -->

                    <div class="card-footer">
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="row">

                                    <div class="form-group">
                                        <div class="form-check">
                                            <input class="form-check-input tableCheckAll" id="checkall" type="checkbox" >
                                            <label class="form-check-label" for="checkall">全选</label>
                                        </div>
                                    </div>
                                    <div class="form-group col-lg-3">
                                        <select class="form-control" name="action">
                                            <option value="">请选择...</option>
                                            <option value="doDelByIds" open-type="del-confirm">
                                                批量删除
                                            </option>
                                        </select>
                                    </div>

                                    <div class="form-group col-lg-3">
                                        <button type="button" class="btn btn-outline-primary batchExec">批量操作</button>
                                    </div>
                                </div>
                            </div>

                            <div class="col-sm-6">
                                #@_paginate()
                            </div>
                        </div>
                    </div>
                    <!-- /.card-footer -->
                </div>
                <!-- /.card -->
            </div>
    </section>
#end
